{template '../../header'}
{template '../../left'}
<div class="card">
    <div class="card-header">
        当前位置：账户管理
    </div>
    <div class="card-body">
        <div class="row mb-2">
            <div class="col-12">
                <form class="form-row">
                    <div class="form-group col-3">
                        <label>账户信息</label>
                        <input class="form-control form-control-sm" autocomplete="new-password" type="text" id="username" name="filter_username" value="<?php echo $filter_username; ?>" placeholder="账户信息" />
                    </div>
                    <div class="form-group col-1">
                        <label>搜索</label>
                        <div class="form-control-static">
                            <button class="btn btn-success btn-sm" type="submit" name="do" value="search"><i class="fa fa-search"></i> 搜索</button>
                        </div>
                    </div>
                    <div class="form-group col-1">
                        <label>添加</label>
                        <div class="form-control-static">
                            <a href="/admin/rbac/user/edit" class="btn btn-primary btn-sm"><i class="fa fa-plus"></i> 添加</a>
                        </div>
                    </div>
                </form>
            </div>
        </div>

        <table class="table table-sm table-striped table-hover">
            <thead>
            <th>
                账户ID
            </th>
            <th>
                账户名
            </th>
            <th>
                用户角色
            </th>
            <th>
                注册时间
            </th>
            <th>
                修改
            </th>
            <th>
                锁定
            </th>			
            </thead>
            <tbody>
                {loop $rows $row}
                <tr>
                    <td>
                        <?php echo $row['uid']; ?>
                    </td>
                    <td>
                        <?php echo $row['username']; ?> / <?php echo $row['realname']; ?>
                    </td>
                    <td>
                        <?php echo $row['rolename']; ?>
                    </td>
                    <td>
                        <?php echo $row['add_time']; ?>
                    </td>
                    <td>
                        <a class="btn btn-primary btn-sm" href="/admin/rbac/user/edit?uid={$row['uid']}">
                            <i class="fa fa-edit"></i>
                        </a>
                    </td>
                    <td>
                        <a class="btn {:$row['locked']==1?'btn-warning':'btn-success'} btn-sm" href="/admin/rbac/user/index?do=lock&uid={$row['uid']}&locked={$row['locked']}">
                            <i class="fa {if $row['locked']==1}fa-lock{else}fa-unlock{/if}"></i></a>
                        </a>
                    </td>
                </tr>
                {/loop}
            </tbody>
        </table>
        {template '../../page'}
    </div>
</div>

{template '../../footer'}